<form id="<?php echo $uniqid;?>" method="post" style="padding: 8px;">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr bgcolor="#FFFFFF">
            <td  class="tlabel" >收货人：</td>
            <td width="80%"><input type="text" v-model="params.consignee"
                                   class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入联系人.." required="true"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td  class="tlabel" >联系电话：</td>
            <td width="80%"><input type="text" v-model="params.phone" maxlength="11"
                                   class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入联系电话.." required="true"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td  class="tlabel" >收货区域：</td>
            <td width="80%">
                <SELECT v-model="params.province_id" @change="params.city_id=0" style="width: 120px" class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox">
                    <template v-for="(vo,index) in prov">
                        <OPTION :value="vo.id">{{vo.name}}</OPTION>
                    </template>
                </SELECT>
                <SELECT v-if="params.province_id>0" v-model="params.city_id" style="width: 140px"  class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox">
                    <template v-for="(vo,index) in city">
                        <OPTION v-if="vo.pid==params.province_id" :value="vo.id">{{vo.name}}</OPTION>
                    </template>
                </SELECT>
                <SELECT v-if="params.province_id>0 && params.city_id>0"  v-model="params.area_id" style="width: 140px" class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox">
                    <template v-for="(vo,index) in area">
                        <OPTION v-if="vo.pid==params.city_id" :value="vo.id">{{vo.name}}</OPTION>
                    </template>
                </SELECT>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td  class="tlabel" >收货地址：</td>
            <td width="80%"><input type="text" style="width:400px;" v-model="params.address"
                                   class="forminput inputstyle textbox-text validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入详细地址.." required="true"></td>
        </tr>
    </table>
</form>

<script>
    var consigneeVm = new Vue({
        el: '#<?php echo $uniqid;?>',
        data: {
            params: JSON.parse('<?php echo addslashes($dataset);?>'),
            prov: JSON.parse('<?php echo addslashes($prov);?>'),
            city: JSON.parse('<?php echo addslashes($city);?>'),
            area: JSON.parse('<?php echo addslashes($area);?>'),
        },
        mounted(){
            this.init();
        },
        methods: {
            init(){},
            submit: function(){
                $.post('/admin/order/consignee/', this.params, function(data){
                    if(data.ret===0){
                        $.messager.show({
                            title:'提示',
                            msg:data.msg,
                            timeout:3000,
                            showType:'slide'
                        });
                        ordereditVm.params.consignee = data.data.consignee;
                        ordereditVm.params.phone = data.data.phone;
                        ordereditVm.params.province_name = data.data.province_name;
                        ordereditVm.params.city_name = data.data.city_name;
                        ordereditVm.params.area_name = data.data.area_name;
                        ordereditVm.params.address = data.data.address;
                        $('#<?php echo $uniqid;?>').form('clear');
                        $("#orderdeliverydlg").dialog('close');
                    }else{
                        $.messager.alert('提示',data.msg,'warning');
                    }
                });
            }
        }
    });
    $('#orderdeliverysubmit').click(function(data){
        consigneeVm.submit();
    })
</script>
